package com.harboursoftware.xstorage.unit.results

import com.harboursoftware.xstorage.results.ErrorResult 
import org.junit.Test 


 class ErrorResponseTest {
	
	@Test
	void test_toXML() {
		def error = ErrorResult.create(ErrorResult.Type.INVALID_ARGUMENT)
		error.message = ''
		error.otherInfos = [ArgumentName : 'x-amz-acl', ArgumentValue : 'kjljljlk']
		assert error.toXML() == '<?xml version="1.0" encoding="UTF-8"?><Error><Code>InvalidArgument</Code><Message></Message>' +
				"<ArgumentName>x-amz-acl</ArgumentName><ArgumentValue>kjljljlk</ArgumentValue><RequestId>" + error.xAmzId2 + "</RequestId>" +
				"<HostId>" + error.xAmzRequestId + "</HostId></Error>"
	}
}
